<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page isELIgnored="false" %> <%-- 新增此行，启用EL表达式解析 --%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html>
<head>
    <title>错误页面 - 用户管理系统</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            margin: 0;
            padding: 20px;
            background-color: #f5f5f5;
            color: #333;
        }
        .container {
            max-width: 800px;
            margin: 0 auto;
            padding: 30px;
            background-color: white;
            border-radius: 8px;
            box-shadow: 0 2px 15px rgba(0,0,0,0.1);
        }
        h1 {
            color: #e74c3c;
            text-align: center;
            border-bottom: 2px solid #eee;
            padding-bottom: 15px;
        }
        .error-content {
            margin: 30px 0;
        }
        .error-message {
            font-size: 18px;
            line-height: 1.6;
            margin: 20px 0;
            padding: 15px;
            background-color: #fce9e9;
            border-left: 4px solid #e74c3c;
            border-radius: 4px;
        }
        .error-details {
            margin: 25px 0;
            padding: 15px;
            background-color: #f9f9f9;
            border-radius: 4px;
            font-family: "Courier New", monospace;
            font-size: 14px;
            line-height: 1.5;
            overflow-x: auto;
        }
        .back-link {
            display: inline-block;
            padding: 12px 25px;
            background-color: #3498db;
            color: white;
            text-decoration: none;
            border-radius: 4px;
            font-weight: bold;
            margin-top: 20px;
        }
        .back-link:hover {
            background-color: #2980b9;
        }
        .suggestions {
            margin-top: 30px;
            padding: 15px;
            background-color: #e8f4f8;
            border-left: 4px solid #3498db;
            border-radius: 4px;
        }
        .suggestions h3 {
            color: #2980b9;
            margin-top: 0;
        }
        .suggestions ul {
            padding-left: 20px;
        }
        .suggestions li {
            margin-bottom: 8px;
        }
    </style>
</head>
<body>
<div class="container">
    <h1>抱歉，系统遇到了一个错误</h1>

    <div class="error-content">
        <div class="error-message">
            <strong>错误信息：</strong> ${exception}
        </div>

        <div class="error-details">
            <strong>请求URL：</strong> ${url}
        </div>

        <div class="suggestions">
            <h3>可能的解决方案：</h3>
            <ul>
                <li>检查您请求的URL是否正确</li>
                <c:if test="${exception.contains('UserNotFoundException')}">
                    <li>您查找的用户可能不存在或已被删除</li>
                </c:if>
                <li>尝试返回首页或用户列表页</li>
                <li>如果问题持续存在，请联系系统管理员</li>
            </ul>
        </div>

        <a href="${pageContext.request.contextPath}/" class="back-link">返回首页</a>
        <a href="${pageContext.request.contextPath}/user/list" class="back-link">返回用户列表</a>
    </div>
</div>
</body>
</html>